#ifndef __GLPRIMITIVERENDERER__
#define __GLPRIMITIVERENDERER__

#include "..\..\Math\Colorb.h"
#include "..\..\Math\Point3.h"
#include "..\..\Math\Matrix4.h"
#include "..\Face.h"
#include "..\Box.h"
#include "..\..\Math\MathHelper.h"
#include "..\PrimitiveRendererBase.h"
#include "GLRenderList.h"

#include <cstdint>
#include <stack>
#include <vector>
#include <wx\thread.h>

class RendererBase;

class GLPrimitiveRenderer : public PrimitiveRendererBase
{
private:
	virtual void DrawImmediate();
	virtual void DrawArrays();

protected:
	bool _vboCompiled;
	RenderListBase *CreateRenderList();
	wxMutex _lock;

public:
	GLPrimitiveRenderer(RendererBase *r);
	~GLPrimitiveRenderer();

	/// <summary>
	/// Called to compile the primitives.
	/// </summary>
	virtual void Compile(const bool &allowCacheLoading);

	/// <summary>
	/// Render this chunk render data.
	/// </summary>
	virtual void Render();
};

#endif	